<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>寄生式继承</title>
</head>
<body>
    <h1>寄生式继承</h1>
   
</body>
<script type="text/javascript">
    
    function createObj (o) {
        var clone = Object.create(o);
        clone.sayName = function () {
            console.log('hi');
        }
        return clone;
    }

    const test = createObj({name:'hehe'});
    test.name = 'xw';
    console.log(test)

</script>
</html>